<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .red {
            background-color: red;
        }

        .green {
            background-color: green;
        }
    </style>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <div :class="{red:isFlag,green:!isFlag}">neirong</div>
    <p>
        <input type="radio" name="sex" v-model="isFlag" :value=true>男
        <input type="radio" name="sex" v-model="isFlag" :value="false">女
    </p>
</div>

<script type="text/javascript">
    const app = new Vue({
        el: "#app",
        data: {
            isFlag: false
        }
    });
</script>
</body>
</html>